package com.baseframe.sms.sign;


import lombok.Getter;

@Getter
public enum SmsScene {

    UNKNOWN(0,"未知"),

    CAPTCHA(1,"验证码"),//验证码

    NOTICE(2,"事务通知"),//通知

    MARKETING(3,"营销推广")

    ;

    private final int code;
    private final String name;

    SmsScene(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public static SmsScene getScene(int code){
        for (SmsScene scene  : values()) {
            if (scene.getCode()==code){
                return scene;
            }
        }
        return SmsScene.UNKNOWN;
    }
}
